package main

import (
    "github.com/gogf/gf/g"
    "github.com/gogf/gf/g/frame/gins"
    "github.com/gogf/gf/g/net/ghttp"
)

func main() {
    s := g.Server()
    s.SetServerRoot("public")
    s.SetNameToUriType(ghttp.NAME_TO_URI_TYPE_ALLLOWER)
    s.SetErrorLogEnabled(true)
    s.SetAccessLogEnabled(true)
    s.SetPort(2333)

    v := g.View()
    v.AddPath("template")

    s.BindHandler("/", func(r *ghttp.Request) {
        content, _ := gins.View().Parse("test.html", nil)
        r.Response.Write(content)
    })

    s.Run()
}
